package com.example.communist_app_api.db.dao;

import com.example.communist_app_api.db.dto.WordDTO;
import com.example.communist_app_api.db.pojoDto.Word;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WordDao {

    int deleteByPrimaryKey(Integer id);

    //insert全部插入
    int insert(Word record);


    Word selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Word record);


    //从数据库中寻找 状态status为正常，类型type是允许的单词
    List<String> selectAllWordByNormalAndAllow();

    //从数据库中寻找 状态status为正常，类型type是禁止的单词
    List<String> selectAllWordByNormalAndDeny();

    //根据Word设置的条件搜索
    List<Word> selectByCondition(Word wordEntity);

    Integer batchInsert(@Param("wordInsertList") List<WordDTO> wordInsertList);
}
